<% include ./inc/inc-tmpt-head %>
<% if (typeof(topics) === "undefined" || topics.length <= 0) { %>
	<div class="alert alert-info">哎呀，还没有任何主题信息，请先<strong><a href="/admin/topic-create.html">创建</a></strong>一个吧！</div>
<% } else { %>
	<table class="table table-striped table-bordered table-hover">
		<thead>
			<tr>
				<th class="span1"><div class="text-center">#</div></th>
				<th class="span2"><div class="text-center">类型</div></th>
				<th>标题</th>
				<th class="span3 text-center"><div class="text-center">更新时间</div></th>
				<th class="span2"><div class="text-center">操作</div></th>
			</tr>
		</thead>
		<tbody>
			<% topics.forEach(function(tpc) { %>
			<tr>
				<td><div class="text-center"><%= tpc.id %></div></td>
				<td><div class="text-center"><a href="/admin/topic-manage.html?t=<%= tpc.catg %>&p=<%= page %>"><%= catgValue(tpc.catg) %></a></div></td>
				<td><a href="/admin/topic-view-<%= tpc.id %>.html?v=full"><%= tpc.title %></a></td>
				<td><div class="text-center"><%= datetimeFormat(tpc.gmt_modify) %></div></td>
				<td>
					<% if(tpc.catg === 'album') { %>
					<div class="text-center"><a class="btn" href="/admin/album-update-<%= tpc.id %>.html">编辑</a></div>
					<% } else { %>
					<div class="text-center"><a class="btn" href="/admin/topic-update-<%= tpc.id %>.html">编辑</a></div>
					<% } %>
				</td>
			</tr>
			<% }); %>
		</tbody>
	</table>
	<div class="pagination pagination-right">
		<ul>
			<% pages.forEach(function(p) { %>
			<% if (p == page) { %>
				<li class="active"><a href="javascript:void(0);"><%= p %></a></li>
			<% } else { %>
				<% if (typeof(catg) === "undefined") { %>
					<li><a href="/admin/topic-manage.html?p=<%= p %>"><%= p %></a></li>
				<% } else { %>
					<li><a href="/admin/topic-manage.html?t=<%= catg %>&p=<%= p %>"><%= p %></a></li>
			<% }}}); %>
		</ul>
	</div>
<% } %>

<% include ./inc/inc-tmpt-foot %>